home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’96 / Talking Telnet / source / Speech / EqualVoiceSpec.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-22  |  556 b   |  26 lines  |  [TEXT/CWIE]

  1. #include    "speech.proto.h"
  2. #include    <Speech.h>
  3.  
  4.  
  5. /* Boolean EqualVoiceSpec(const VoiceSpec * voice1, const VoiceSpec * voice2)
  6.  
  7.     returns true if the voice voice1 points to is the same voice that voice2 points to
  8. */
  9.  
  10. Boolean EqualVoiceSpec(const VoiceSpec * voice1, const VoiceSpec * voice2)
  11. {
  12.     if (voice1 == voice2) {
  13.         return true;
  14.     }
  15.     
  16.     if (nil == voice1 || nil == voice2) {
  17.         return false;
  18.     }
  19.     
  20.     return voice1 -> id == voice2 -> id && voice1 -> creator == voice2 -> creator;
  21.  
  22.     /*    Alternate method:
  23.     return !memcmp(voice1, voice2, sizeof(*voice1));
  24.     */
  25. }
  26.